cmake_minimum_required(VERSION 3.5)

project(QML LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 6.4 COMPONENTS Core Core5Compat Gui Qml Quick REQUIRED)


message("BuildTargetDir" ${BuildTargetDir})
set(EXECUTABLE_OUTPUT_PATH ${BuildTargetDir})

#if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3)
#    qt_standard_project_setup()
#endif()

set(PROJECT_NAME DxOnlineTest)

FILE (GLOB_RECURSE SOURCE "./*.h" "./*.cpp" "./*.c")
fileRecursive(${CMAKE_CURRENT_SOURCE_DIR} "*.qml" QML_RES)

add_executable(${PROJECT_NAME} ${SOURCE})
qt_add_resources(${PROJECT_NAME} "configuration"
    PREFIX "/"
    FILES
        ${QML_RES}
)

# target_include_directories(${PROJECT_NAME}
# )

# if(${DXOFDVIEWER_BUILD_WEB_INTEGRATION})
# elseif(${WASM})
# else()


target_link_libraries(${PROJECT_NAME}
    Qt6::Core
    Qt6::Gui
    Qt6::Qml
    Qt6::Quick
   )
include(GNUInstallDirs)
